﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="Role.aspx.cs" Inherits="Admin_Role" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style8
        {
            text-align: center;
        }
        .style9
        {
            width: 22px;
        }
        .style10
        {
            text-align: center;
        }
        .style11
        {
            text-align: right;
            width: 475px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td colspan="3" style="font-weight: 700; color: #0066FF; text-align: center">
                <asp:Label ID="Label1" runat="server" Text="Role"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style8" colspan="3">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    CellPadding="4" DataKeyNames="roleId" DataSourceID="SqlDataSource1" 
                    ForeColor="#333333" GridLines="None" AllowPaging="True" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="roleId" HeaderText="roleId" InsertVisible="False" 
                            ReadOnly="True" SortExpression="roleId" />
                        <asp:BoundField DataField="roleName" HeaderText="roleName" 
                            SortExpression="roleName" />
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    DeleteCommand="DELETE FROM [tblRole] WHERE [roleId] = @roleId" 
                    InsertCommand="INSERT INTO [tblRole] ([roleName]) VALUES (@roleName)" 
                    SelectCommand="SELECT * FROM [tblRole]" 
                    UpdateCommand="UPDATE [tblRole] SET [roleName] = @roleName WHERE [roleId] = @roleId">
                    <DeleteParameters>
                        <asp:Parameter Name="roleId" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="roleName" Type="String" />
                        <asp:Parameter Name="roleId" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="roleName" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style8" colspan="3">
                <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add" />
&nbsp;
                <asp:Button ID="bntEdit" runat="server" onclick="bntEdit_Click" Text="Edit" />
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style8" colspan="3">
                <asp:Label ID="Label2" runat="server" style="font-weight: 700; color: #0066FF" 
                    Text="Edit" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                <asp:Label ID="Label3" runat="server" style="font-weight: 700; color: #000000" 
                    Text="Id" Visible="False"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="txtId" runat="server" Visible="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style11">
                <asp:Label ID="Label4" runat="server" style="font-weight: 700; color: #000000" 
                    Text="Name" Visible="False"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="txtName" runat="server" Visible="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10" colspan="3">
                <asp:Button ID="btnEdit1" runat="server" onclick="btnEdit1_Click" 
                    style="width: 37px" Text="Edit" Visible="False" />
            </td>
        </tr>
    </table>
</asp:Content>

